Imports CasClientBase
Imports ccapps.Util
Imports ccapps.persistent.MVPN_Lib


Namespace Web.page

    Public Class MVPN_FullBatch
        Inherits [lib].BasePage

        Protected WithEvents DefProf As System.Web.UI.HtmlControls.HtmlSelect
        Protected WithEvents txt_VPNID As System.Web.UI.WebControls.TextBox
        Protected WithEvents btn_Check As System.Web.UI.WebControls.Button
        Protected WithEvents pnl_giris As System.Web.UI.WebControls.Panel
        Protected WithEvents pnl_Onay As System.Web.UI.WebControls.Panel
        Protected WithEvents lbl_vpnid_id As System.Web.UI.WebControls.Label
        Protected WithEvents lbl_Vpn_Name As System.Web.UI.WebControls.Label
        Protected WithEvents btn_Cancel As System.Web.UI.WebControls.Button
        Protected WithEvents btn_PrepareBatch As System.Web.UI.WebControls.Button
        Protected WithEvents lbl_MinCoid As System.Web.UI.WebControls.Label
        Protected WithEvents proc As System.Web.UI.HtmlControls.HtmlInputHidden

#Region " Web Form Designer Generated Code "

        'This call is required by the Web Form Designer.
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

        End Sub
        Protected WithEvents ltlAlert As System.Web.UI.WebControls.Literal
        Protected WithEvents Button66 As System.Web.UI.WebControls.Button
        Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm
        'Protected WithEvents Button1 As System.Web.UI.HtmlControls.HtmlInputButton

        'NOTE: The following placeholder declaration is required by the Web Form Designer.
        'Do not delete or move it.
        Private designerPlaceholderDeclaration As System.Object

        Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
            'CODEGEN: This method call is required by the Web Form Designer
            'Do not modify it using the code editor.
            InitializeComponent()
        End Sub

#End Region

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'Put user code to initialize the page here
            Me.PageTitle = "MVPN - Full Batch"
            Me.HelpDocName = ""
            Message = ""

            If Session("MVPN_by_pass_tmcode_black_profile") = "" Then
                Dim l_dummy_MVPN_by_pass_tmcode_black_profile As String
                Get_Role_Control_Ability(Session("role_id"), l_dummy_MVPN_by_pass_tmcode_black_profile)
                Session("MVPN_by_pass_tmcode_black_profile") = l_dummy_MVPN_by_pass_tmcode_black_profile
            End If

            pnl_giris.Visible = True
            pnl_Onay.Visible = False
        End Sub

        Private Sub btn_PrepareBatch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_PrepareBatch.Click
            CopyAllOrders(txt_VPNID.Text, Session("user"))
            Message = "alert('Full batch request given.');"
        End Sub

        Private Sub btn_Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Cancel.Click
            Response.Redirect("MVPN_FullBatch.aspx")
        End Sub

        Private Sub btn_Check_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Check.Click
            Dim l_dummy1, l_aktifhatadedi As String
            Dim l_result As String
            l_result = GetVpnHeaders(txt_VPNID.Text, lbl_Vpn_Name.Text, l_dummy1, l_aktifhatadedi)
            If l_result = "OK" And l_aktifhatadedi <> "OK" Then
                lbl_vpnid_id.Text = txt_VPNID.Text
                lbl_MinCoid.Text = l_aktifhatadedi
                pnl_giris.Visible = False
                pnl_Onay.Visible = True
            Else
                Message = "alert('Not existing or empty VPNID!');"
                pnl_giris.Visible = True
                pnl_Onay.Visible = False
            End If
        End Sub
    End Class
End Namespace
